package gov.pbc.nn.kjgl.AbroadApproval.view;

import gov.pbc.nn.core.dao.CommonJdbcDao;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import javax.sql.DataSource;

import org.springframework.stereotype.Component;

import com.bstek.ureport.env.EnvironmentProvider;

@Component
public class UreportJDBC implements EnvironmentProvider {

	@Resource(name = CommonJdbcDao.BEAN_ID)
	private CommonJdbcDao jdbcDao;

	@Override
	public Map<String, DataSource> getDatasourceMap() {
		DataSource ds = jdbcDao.getJdbcTemplate().getDataSource();
		DataSource ds2 = jdbcDao.getJdbcTemplate("pbcnn.core.dataSource").getDataSource();
		Map<String, DataSource> map = new HashMap<String, DataSource>();
		map.put("A2pbc", ds);
		map.put("A2nnpbc", ds2);
		return map;
	}

	@Override
	public String getTemporaryDirectory() {
		// TODO Auto-generated method stub
		return null;
	}

}
